package com.jzo2o.foundations.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jzo2o.api.foundations.dto.response.ServeAggregationResDTO;
import com.jzo2o.foundations.model.domain.Serve;
import com.jzo2o.foundations.model.dto.response.ServeAggregationSimpleResDTO;
import com.jzo2o.foundations.model.dto.response.ServeAggregationTypeSimpleResDTO;
import com.jzo2o.foundations.model.dto.response.ServeCategoryResDTO;
import com.jzo2o.foundations.model.dto.response.ServeResDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author itcast
 * @since 2023-07-03
 */
public interface ServeMapper extends BaseMapper<Serve> {
    /**
     * 区域服务查询
     * @param regionId 区域id
     * @return
     */
    List<ServeResDTO> queryServeListByRegionId(@Param("regionId") Long regionId);


    /**
     * 查找指定区域下有多少数量是status状态
     * @param regionId 区域id
     * @param status 启用状态
     * @return
     */
    Integer queryServeSaleStatusCount(@Param("regionId") Long regionId, @Param("status") Integer status);

    /**
     * 查找指定服务id下有多少区域是使用这个服务的
     * @param serveId 服务项id、
     * @param status 上架状态
     * @return
     */
    Integer queryServeRegionSaleStatusCount(@Param("serveId") Long serveId, @Param("status") Integer status);
}
